package com.myList{
	import com.bases.TLable;
	import com.bases.TUIComponent;
	import com.Interface.IItem;
	
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	/**
	 * 联系人List项内容 
	 * @author Administrator
	 * 
	 */	
	public class MyItem extends TUIComponent implements IItem{
		private var label:TLable;
		private var myData:MyData;
		
		public function MyItem() {
			super();
			label=new TLable();
			this.addChild(label);
			this.relayout();
			this.addEventListener(MouseEvent.CLICK,handler);
		}
		
		override protected function relayout():void{
			super.relayout();
			label.setSize(100,20);
		}
		
		private function handler(e:MouseEvent):void{
			this.dispatchEvent(new Event("ItemClick",true));
		}
		
		public function set userData(value:*):void {
			myData = value;
			this.label.text=myData.label;
		}
		
		public function get userData():* {
			return myData;
		}
	}
}